﻿using huqiang;
using huqiang.Core.HGUI;
using huqiang.UIModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

public class TestSceneHelper:TestPageHelper
{
    public string assemblyName="Assembly-CSharp";
    public string pageName;
    public void Awake()
    {
        if (TargetRender == null)
            TargetRender = GetComponent<HGUIRender>();
    }
    public override void LoadTestPage()
    {
        HImage.imageLoader = new ImageLoader();//设置默认的图片加载器
        UIElement.DisposeAll();
        HCanvas.RegCanvas(TargetRender);
        HCanvas.CurrentCanvas = TargetRender.canvas;
        App.Initial( TargetRender.canvas);
        var ass = Assembly.Load(assemblyName);
        var typ = ass.GetType(pageName);
        if (typ != null)
            UIPage.LoadPage(typ);
    }
}
